Zennolab.CommandCenter
AddRange(Document[]) Method
See Also  Example Send Feedback
Zennolab.CommandCenter Namespace > DocumentCollection Class > AddRange Method : AddRange(Document[]) Method
documents

Type: Zennolab.CommandCenter.Document[]

The array whose documents should be added to the end of the DocumentCollection. The collection itself cannot be null.

Adds the documents of the specified array to the end of the DocumentCollection.

Syntax

C# 
public void AddRange( 
   Document[] documents
)

Parameters

documents

Type: Zennolab.CommandCenter.Document[]

The array whose documents should be added to the end of the DocumentCollection. The collection itself cannot be null.

Example

The following code example demonstrates the AddRange method and various other methods of the DocumentCollection class that act on ranges.The AddRange method is called, with the array as its argument. The result is that the current elements of the list are added to the end of the list, duplicating all the elements.
C#Copy Code
using System;
using Zennolab.CommandCenter;
 
namespace Sample
{
    internal class Example
    {
        public static int Execute(Instance instance)
        {
            instance.ClearCookie();
            
            Tab tab = instance.MainTab;
            if ((tab.IsVoid) || (tab.IsNull)) return -1;
            if (tab.IsBusy) tab.WaitDownloading();
            tab.Navigate("zennolab.com");
            if (tab.IsBusy) tab.WaitDownloading();
            
            DocumentCollection docCol = tab.AllDocuments;
            
            if ((tab.IsVoid) || (tab.IsNull)) return -1;
            if (tab.IsBusy) tab.WaitDownloading();
            tab.Navigate("lessons.zennolab.com");
            if (tab.IsBusy) tab.WaitDownloading();
            
            DocumentCollection newDocCol = tab.AllDocuments;
            
            docCol.AddRange(newDocCol.Documents);
            
            return 0;
        }
    }
}
PHPCopy Code
<?php
import namespace System;
import namespace Zennolab:::CommandCenter;
 
class Example
{
    public static function Execute($instance)
    {
        $instance->ClearCookie();
            
        $tab = $instance->MainTab;
        if (($tab->IsVoid) || ($tab->IsNull)) return -1;
        if ($tab->IsBusy) $tab->WaitDownloading();
        $tab->Navigate("zennolab.com");
        if ($tab->IsBusy) $tab->WaitDownloading();
            
        $docCol = $tab->AllDocuments;
            
        if (($tab->IsVoid) || ($tab->IsNull)) return -1;
        if ($tab->IsBusy) $tab->WaitDownloading();
        $tab->Navigate("lessons.zennolab.com");
        if ($tab->IsBusy) $tab->WaitDownloading();
            
        $newDocCol = $tab->AllDocuments;
            
        $doc->AddRange($newDocCol);
            
        return 0;
    }
}
?>

Remarks

The order of the elements in the collection is preserved in the DocumentCollection.

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2011 All Rights Reserved.